<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style></style>
    <script>
      var num1 = 3;
      var num2 = 5;
      var result = num1 + num2;
      console.log(result);
      var str = '10';
      console.log(num1 + str);//310
      //Java是一个纯面向对象语言，而C++、JS不是纯面向对象语言
      //parseInt就是JS定义全局函数
      var result2 = num1 + parseInt(str);
      console.log(result2);
      alert(result2);
    </script>
</head>
<body>

</body>
</html>